import * as types from '../constant/action-types'

export default (state = {read: {content: []}, unRead: []}, action) => {
  switch (action.type) {
    case types.REFRESH_NOTIFICATIONS:
      if (action.status === 'read') { return Object.assign({}, state, {read: action.notifications}) }
      return Object.assign({}, state, {unRead: action.notifications})
    default:
      return state
  }
}
